<%@page import="com.qmerak.entity.MemberEntity"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>工会信息查询</title>
<link rel="stylesheet" type="text/css"
	href="../../css/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="../../css/themes/icon.css" />
<script type="text/javascript" src="../../js/jquery-1.7.2.js"></script>
<script type="text/javascript"
	src="../../js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../js/ListData.js"></script>
<script type="text/javascript" src="../../js/util.js"></script>
<script type="text/javascript">
	$(function() {
		$('#tt').datagrid({});
	})
	function loadDatas() {
		var condition = "";
		var panel = $("#conditionPanel").panel("body");
		var id = $("#id", panel).val();
		if ("undefined" != id && "" != id) {
			condition += " id='" + id + "'";
		}
		var province = $("#province", panel).val();
		if ("undefined" != province && "" != province) {
			if ("" != condition) {
				condition += " and ";
			}
			condition += " province='" + province + "'";
		}
		var city = $("#city", panel).combobox("getValue");
		if ("undefined" != city && "" != city) {
			if ("" != condition) {
				condition += " and ";
			}
			condition += " city='" + city + "'";
		}

		$.get("../../view/findUnions", {
			condition : condition
		}, function(str) {
			if (typeof str == "object" && str instanceof Array) {
				$('#tt').datagrid("loadData", str);
			}
		})
	}
</script>
<style type="text/css">
body {
	margin: 0px;
	padding: 0px;
	width: 100%;
	height: 100%;
}
</style>
</head>
<body style="margin: 0">
	<div id="conditionPanel" class="easyui-panel"
		style="width: 800px; padding: 10px; text-align: left;"
		data-options="title:'查询条件',collapsible:true,collapsed:true">
		<table align="left" width="100%">
			<tr>
				<td nowrap="nowrap" width="100" align="right">所在省：</td>
				<td nowrap="nowrap" width="200" align="left"><input
					name="province" id="province" class="easyui-combobox"
					style="width: 170px;"
					data-options="
					data:list_province,
					valueField: 'value',
					textField: 'text'
			" /></td>
				<td nowrap="nowrap" width="100" align="right">所在市：</td>
				<td nowrap="nowrap" width="200" align="left"><input name="city"
					id="city" class="easyui-combobox" style="width: 170px;"
					data-options="
					data:list_city,
					valueField: 'value',
					textField: 'text'
			" /></td>
			</tr>
			<tr>
				<td nowrap="nowrap" width="100" align="right">所在工会组织机构名称：</td>
				<td nowrap="nowrap" width="200" align="left" colspan="3"><input
					id="id" name="id" class="easyui-combotree"
					data-options="multiple:false,url:'../../view/orgcombo'"
					style="width: 400px;" /></td>
			</tr>
		</table>
	</div>
	<hr>
	<div id="tb">
		<div style="clear: right;">
			<a href="#" class="easyui-linkbutton" data-options="plain:true"
				onclick="javascript:loadDatas()">查询</a>
		</div>
	</div>
	<table id="tt" class="easyui-datagrid"
		data-options="title:'工会信息',singleSelect:true,rownumbers:true"
		style="width: 800px; height: 200px;">
		<thead>
			<tr>
				<th data-options="field:'unionCode',width:80">机构编码</th>
				<th data-options="field:'unionName',width:80">机构名称</th>
				<th data-options="field:'setupDate',width:80">成立时间</th>
				<th data-options="field:'officeSite',width:80">办公地点</th>
				<th data-options="field:'tel',width:80">办公电话</th>
			</tr>
		</thead>
	</table>
</body>
</html>